@extends('admin.layout.layout', ['row' => @$page])

@section('contain')


    <div class="portlet">
        <div class="portlet-title">
            <div class="caption">
                <x-portlet-breadcrumb :page="$page"></x-portlet-breadcrumb>
            </div>
            <div class="actions">
                <div class="item">
                    <a href="/{{ request()->path() }}/download_template" class="btn btn-sm btn-primary">{{ ts('DOWNLOADTEMPLATE') }}</a>
                </div>
                <div class="item">
                    <a href="/{{ request()->path() }}/bulk_import" class="btn btn-sm btn-primary">{{ ts('BULKIMPORT') }}</a>
                </div>
                <div class="item">
                    <a href="/{{ request()->path() }}/create" class="btn btn-sm btn-primary">{{ ts('addnew') }}</a>
                </div>
            </div>
        </div>

        <div class="filter-wrapper">
            <form action="/{{ request()->path() }}/" class="form-inline filter-form">
                <div class=" input-group mb-3 custom-control-inline">
                    <div class="input-group-prepend">
                        <select name="label" class="form-control">
                            <option value="user_id" {{ request()->input('label') == 'user_id' ? 'selected' : '' }}>{{ ts('userid') }}</option>
                            <option value="module" {{ request()->input('label') == 'module' ? 'selected' : '' }}>{{ ts('operationmodule') }}</option>
                        </select>
                    </div>
                    <input type="text" class="form-control" name="value" value="{{ request()->input('value') }}">
                </div>
                <x-flatpickr-date-range></x-flatpickr-date-range>
                <div class="mb-3">
                    <button class="btn btn-primary">{{ ts('SEARCH') }}</button>
                    <a href="/{{ request()->path() }}/" class="btn btn-warning">{{ ts('RESET') }}</a>
                </div>

            </form>
        </div>

        <div>
            <table class="table table-s1">
                <thead>
                <tr class="order_column">
                    <th style="width: 75px;">{{ ts('sequence') }}</th>
                    <th style="width: 100px;" data-column="user_id">操作账号</th>
                    <th style="width: 150px;" data-column="module">操作模块</th>
                    <th style="width: 200px;">操作类型</th>
                    <th style="width: 100px;" data-column="created_at">操作时间</th>
                    <th style="width:270px">{{ ts('OPTION') }}</th>
                </tr>
                </thead>
                <tbody>
                @foreach($data as $k => $v)
                    <tr class="item-list">
                        <td class="text-center">
                            <div class="truncated-3">{{ @$data->firstItem()+$k }}</div>
                        </td>
                        <td>
                            <div class="truncated-3">{{ @$v->user_id }}</div>
                        </td>
                        <td>
                            <div class="truncated-3">{{ @$v->module }}</div>
                        </td>
                        <td>
                            <div class="truncated-3">{{ @$v->activity }}</div>
                        </td>
                        <td>
                            <div class="truncated-3">{{ @$v->created_at }}</div>
                        </td>
                        <td>
                            <a class="btn btn-success btn-sm" href='/{{ request()->path() }}/{{ $v->id }}' target="_blank">{{ ts('VIEW') }}</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>

            <div class="row my-3">
                <div class="col">
                    {{ $data->appends(request()->input())->links() }}
                </div>
            </div>
        </div>

    </div>


@endsection